﻿<%@ Page Language="C#" Theme="WebMaster" MasterPageFile="~/WebMaster/MasterPage.master"
    AutoEventWireup="true" Inherits="SouthernLand.WebMaster.Membership.ManageUsers"
    Title="Manage Users" CodeBehind="ManageUsers.aspx.cs" %>

<%@ Register Src="~/WebMaster/Controls/Title.ascx" TagName="Title" TagPrefix="uc" %>
<asp:Content ID="MainContent" ContentPlaceHolderID="PageContent" runat="Server">
    <uc:Title ID="Title1" runat="server" ResourceKey='Security_Title' />
    <br />
    <asp:UpdatePanel ID="UserUpdatePanel" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <table width="700" align="center">
                <tr>
                    <td>
                        <table width="100%">
                            <tr>
                                <td width="30%">
                                    <asp:HyperLink runat="server" ID="NewUser" Font-Bold="true" Font-Underline="true"></asp:HyperLink>
                                </td>
                                <td align="right">
                                    Search by:
                                    <asp:DropDownList ID="RolesDropDownList" runat="Server" CssClass="Textbox" Width="150px" />
                                    <asp:TextBox runat="server" ValidationGroup="Search" ID="txtKeyword" Width="150" />
                                    <asp:Button runat="server" ValidationGroup="Search" ID="btSearch" Text="Search" OnClick="btSearch_Click" />
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td align="center">
                        <br />
                        <asp:GridView runat="server" Width="700" DataSourceID="ItemDataSource" ID="GridViewItem">
                            <Columns>
                                <asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="20px" HeaderStyle-Width="20px">
                                    <HeaderTemplate>
                                        <input id="chkAll" onclick="javascript:SelectAllCheckboxes(this);" runat="server"
                                            type="checkbox" />
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <asp:CheckBox runat="server" ID="chkSelect" ToolTip='<%# Eval("UserName") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Company" HeaderStyle-HorizontalAlign="left" ItemStyle-HorizontalAlign="left">
                                    <HeaderTemplate>
                                        <%=ResourceManager.GetString("UserName") %></HeaderTemplate>
                                    <ItemTemplate>
                                        <%# Eval("UserName")%>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Email" HeaderStyle-Width="150" ItemStyle-Width="150"
                                    HeaderStyle-HorizontalAlign="left" ItemStyle-HorizontalAlign="left">
                                    <ItemTemplate>
                                        <%# Eval("Email") %>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Address" HeaderStyle-Width="150" HeaderStyle-HorizontalAlign="left"
                                    ItemStyle-Width="150" ItemStyle-HorizontalAlign="left">
                                    <HeaderTemplate>
                                        <%=ResourceManager.GetString("Address")%></HeaderTemplate>
                                    <ItemTemplate>
                                        <%# Eval("Address") %>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Phone" HeaderStyle-Width="100" HeaderStyle-HorizontalAlign="left"
                                    ItemStyle-Width="100" ItemStyle-HorizontalAlign="left">
                                    <HeaderTemplate>
                                        <%=ResourceManager.GetString("Phone")%></HeaderTemplate>
                                    <ItemTemplate>
                                        <%# Eval("Phone") %>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Edit" ItemStyle-Width="40" HeaderStyle-Width="40"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                                    <HeaderTemplate>
                                        <%=ResourceManager.GetString("Edit")%></HeaderTemplate>
                                    <ItemTemplate>
                                        <a href="CreateUser.aspx?UserName=<%# Eval("UserName") %>&Action=Edit">
                                            <img src="<%=Globals.ImagesUrlWebMaster()%>Edit.gif" border="0" />
                                        </a>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <EmptyDataTemplate>
                                <table align="center" width="300" border="0" bordercolorlight="#0099cc" bordercolor="#0099cc">
                                    <tr>
                                        <td height="50" align="center">
                                            <div align="center" id="EmptyData">
                                                <%=ResourceManager.GetString("DataEmpty") %>
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                            </EmptyDataTemplate>
                        </asp:GridView>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <br />
                        <asp:LinkButton runat="server" ID="btDelete" Text=" Delete " OnClick="btDelete_Click" />
                        <br />
                        <br />
                        <br />
                    </td>
                </tr>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:ObjectDataSource ID="ItemDataSource" runat="server" SelectMethod="GetAllUser"
        TypeName="SouthernLand.Common.BOL.User.User"></asp:ObjectDataSource>
    <asp:ObjectDataSource ID="SearchDataSource" runat="server" SelectMethod="AdminSearch"
        TypeName="SouthernLand.Common.BOL.User.User">
        <SelectParameters>
            <asp:ControlParameter Name="Keyword" ControlID="txtKeyword" PropertyName="Text" Type="string"
                DefaultValue=" " />
            <asp:ControlParameter Name="RoleName" ControlID="RolesDropDownList" PropertyName="SelectedValue"
                Type="string" DefaultValue="" />
        </SelectParameters>
    </asp:ObjectDataSource>
</asp:Content>
